#ifndef POPUPCLIENTUPDATEMESSAGE_HPP_
#define POPUPCLIENTUPDATEMESSAGE_HPP_

#include <PopupLibTypes.hpp>
#include <PopupLoggerUI.hpp>
#include "PopupAbstractMessage.hpp"

namespace Popup
{

  struct UserUpdateMsg : public AbstractMessage, public User
  {
    enum
    {
      USERID,
      USERNICKNAME,
      AVATAR_RAW_DATA,
      AVATAR_FILENAME,
      MODE,
      HEALTH
    };

    //! Constructor used in order to send a user update notification
    UserUpdateMsg(const User & p_user,
                  unsigned short p_updateMask = POPUP_USER_FIELD_ALL)
    : AbstractMessage(POPUP_MSG_TYPE_USER_UPDATE),
      User(p_user), updateMask(p_updateMask) {}

    //! Constructor used in order to receive a user upate notification
    UserUpdateMsg(const Message *p_message,
                  const std::string & p_resourcePath = ".");

    //!@Override
    bool onSend();

    //!@Override
    bool onReceive();

    //! Returns update mask
    unsigned short getUpdateMask() const;

    void dump() const;

  private:
    unsigned short updateMask;
    std::string resourcePath;
  };
}
#endif // POPUPCLIENTUPDATEMESSAGE_HPP_
